#include "dbusimpl.h"

DbusImpl::DbusImpl(QString appName, MdiAreaPlayer* displayPlayer, QObject *parent) : DbusApp(appName,parent)
{
    m_displayPlayer = displayPlayer;
    QObject::connect(displayPlayer,SIGNAL(mPlayerKeyPress(int)),this,SLOT(displayKeyEvent(int)));
}

// implementation des methodes de DbusApp
void DbusImpl::requestMedia(QString reqkey, QString askerApp, QString reqName, QString reqParam){

}

QString DbusImpl::getInfo(QString infokey){
    return "not yet implemented";
}
void DbusImpl::displayKeyEvent(int keyCode){
    if(Qt::Key_Escape == keyCode){
        emit(onHome());
    }
}

void DbusImpl::show(){
    this->m_displayPlayer->showFullScreen();
    this->m_displayPlayer->activateWindow();
    this->m_displayPlayer->raise();
    this->m_displayPlayer->setFocus();
    //this->m_displayPlayer->grabKeyboard();
}

void DbusImpl::hide(){
    this->m_displayPlayer->hide();
}



